package com.ch999.comparedata.entity;

import lombok.Data;
import lombok.Getter;

@Getter
public enum DataSourceEnum {

    MYSQL("MYSQL","MYSQL"),
    SQLSERVER("SQLSERVER","Microsoft SQL Server");


    private String code;

    private String value;

    DataSourceEnum(String code, String value) {
        this.code = code;
        this.value = value;
    }

    public static String getValue(String value){
        for (DataSourceEnum dataSourceEnum:DataSourceEnum.values()){
            if (dataSourceEnum.value==value){
                return dataSourceEnum.code;
            }
        }
        return null;
    }



    public static void main(String[] args) {
        System.out.println(DataSourceEnum.getValue("MYSQL"));
    }
}
